<?php
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="keywords" content="jquery,ui,easy,easyui,web">
	<meta name="description" content="easyui help you build your web page easily!">
	<title>广告推广活动管理</title>
    
    <link rel="stylesheet" type="text/css" href="js/themes/default/easyui.css">  
    <link rel="stylesheet" type="text/css" href="js/themes/icon.css">  
    <link rel="stylesheet" type="text/css" href="js/admin.css">
    
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="js/jz.js"></script>
	<script type="text/javascript">
		$(function(){
			$('#dg').edatagrid({
				url: 'get_ad.php',
				saveUrl: 'save_ad.php',
				updateUrl: 'update_ad.php',
				destroyUrl: 'destroy_ad.php'
			});
		});
	</script>
</head>
<body>
	<h2>广告推广活动管理</h2>
	
	<table id="dg" title="推广活动" style="width:700px;height:550px"
			toolbar="#toolbar" pagination="true" idField="id"
			rownumbers="true" fitColumns="true" singleSelect="true">
		<thead>
			<tr>
				<th field="location" width="50" editor="{type:'combobox',options:{
								valueField:'value',
								textField:'name', 
								panelHeight:'80', 
                                data:[{'name':'top',value:'top'},{'name':'left',value:'left'},{'name':'right',value:'right'}],  
                                required:true}}">位置</th>
				<th field="ad_link" width="50" editor="{type:'validatebox',options:{required:true}}">广告页面链接</th>
				<th field="pic_link" width="50" editor="{type:'validatebox',options:{required:true}}">图片链接</th>
				<th field="desc" width="50" editor="{type:'validatebox',options:{required:true}}">描述</th>
				<th field="weight" width="50" editor="{type:'numberbox',options:{min:0, max:100}}">权重</th>
			</tr>
		</thead>
	</table>
	<div id="toolbar">
		<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('addRow')">增加</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">删除</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#dg').edatagrid('saveRow')">保存</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">取消</a>
	</div>
	
</body>
</html>
